package com.wb.business.controller;

import org.shoukaiseki.aqoeous.model.CustomQO;
import org.shoukaiseki.aqoeous.processor.CustomQOProcessor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.repository.NoRepositoryBean;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;

@NoRepositoryBean
public class BaseController {

    @Autowired
    protected CustomQOProcessor customQOProcessor;


    public Map<String, Object> parserCustomQO(List<CustomQO> list){
        Map<String, Object> qoMapList = customQOProcessor.parserCustomQO(list);
        return qoMapList;
    }

    public Map<String, Object> parserCustomQO(CustomQO... customQOs){
        List list = Stream.of(customQOs).collect(Collectors.toList());
        Map<String, Object> qoMapList = customQOProcessor.parserCustomQO(list);
        return qoMapList;
    }


}
